package com.yequan.file.list;

import java.io.IOException;
import java.nio.file.*;
import java.util.stream.Stream;

/**
 * @author yq
 * @date 2020/07/13
 */
public class ListFile {

    public static void main(String[] args) throws IOException {
        long start = System.currentTimeMillis();
        getFileCount();
        System.out.println("耗时: " + (System.currentTimeMillis() - start) + " ms");
    }

    public static void getFileCount() throws IOException {
        String strPath = "E:\\TEMP";
        Path path = Paths.get(strPath);
        Stream<Path> list = Files.list(path);
        System.out.println(list.count());
    }


}
